<!DOCTYPE html>
<html class="ui-page-login">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <script src="__PUBLIC__/home/plugins/layer/layer.js"></script>
    <script src="__PUBLIC__/mui/js/mui.min.js"></script>
    <script src="__PUBLIC__/js/angular.js"></script>
    <script src="__PUBLIC__/common.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/mui/css/mui.css" />
    <style>
        #member-login{
            display: none;
        }
        .area {
            margin: 20px auto 0px auto;
        }

        .mui-input-group {
            margin-top: 10px;
        }

        .mui-input-group:first-child {
            margin-top: 20px;
        }

        .mui-input-group label {
            width: 30%;
            font-size: 15px;
            color: grey;

        }

        .mui-input-row label~input,
        .mui-input-row label~select,
        .mui-input-row label~textarea {
            width: 70%;
        }

        .mui-checkbox input[type=checkbox],
        .mui-radio input[type=radio] {
            top: 6px;
        }

        .mui-content-padded {
            margin-top: 25px;
        }

        .mui-btn {
            padding: 10px;
        }

        .link-area {
            display: block;
            margin-top: 25px;
            text-align: center;
        }

        .spliter {
            color: #bbb;
            padding: 0px 8px;
        }

        .oauth-area {
            position: absolute;
            bottom: 20px;
            left: 0px;
            text-align: center;
            width: 100%;
            padding: 0px;
            margin: 0px;
        }

        .oauth-area .oauth-btn {
            display: inline-block;
            width: 50px;
            height: 50px;
            background-size: 30px 30px;
            background-position: center center;
            background-repeat: no-repeat;
            margin: 0px 20px;
            /*-webkit-filter: grayscale(100%); */
            border: solid 1px #ddd;
            border-radius: 25px;
        }

        .oauth-area .oauth-btn:active {
            border: solid 1px #aaa;
        }

        .oauth-area .oauth-btn.disabled {
            background-color: #ddd;
        }

        .login-active {
            background: #f3363a;
        }
        .content{
            width: 70%;
            float: right;
            line-height: 40px;
            height: 40px;
            text-indent: 2em;
            font-size: 16px;
            text-align: right;
            padding-right: 1em;

        }
        .go-item{
            position: absolute;
            bottom: 0;
            left: 0 ;
            right: 0;
            padding: 0;
            margin: 0;
            background: white;
            height: 60px;
            text-align: center;

        }
        #user-login .mui-input-row .time{
            width: 65%;
        }
        #user-login .mui-input-row .status{
            width: 35%;
            font-size: 15px;
            font-weight: bold;
            font-family: "Microsoft YaHei UI Light";
        }
        #user-login .mui-input-group{
            margin-top: 0;
        }
        #withdraw{
            color: white;font-size: 16px;line-height: 44px;
            margin: 0;padding: 0;height: 44px;
        }
        .xiaoji .mui-input-row:nth-child(1):after {
            background-color: white;
        }
        .xiaoji .good-name{color: black  }
        .xiaoji .good-num{ color: grey;font-size: 14px }
        .xiaoji .good-price{  color: #f2373b}
        .xiaoji .good-total{  color: #f2373b ;font-size: 15px}
        .xiaoji .good-total span{  color: black }
        .agent-details-btn{
            position: absolute;
            top: 120%;
            width: 100%;
        }
        .agent-details-btn button{
            margin: 0 auto;
            display: block;
        }

    </style>
    <link rel="stylesheet" href="__PUBLIC__/js/nice-validator-0.10.11/dist/jquery.validator.css" />
    <script src="__PUBLIC__/js/nice-validator-0.10.11/dist/jquery.validator.js"></script>
    <script src="__PUBLIC__/js/nice-validator-0.10.11/dist/local/zh-CN.js"></script>
</head>
<body ng-app="myApp" ng-controller="Ctrl" ng-cloak>
<header class="mui-bar mui-bar-nav" style="background:#f3363a;" >
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color: white"></a>
    <h1 class="mui-title login-item" style="color: white">代理详情</h1>
</header>
<div class="mui-content" id="user-login" >
    <div class="mui-input-group">
        <div style="height: 10px;background: #efeff4;"></div>
        <div class="mui-input-row">
            <label style="width: 45%;">官方授权合伙人</label>
            <div class="content" style="width: 55%;">
                {{ag.name}}
            </div>
        </div>
        <!--<div class="mui-input-row">-->
            <!--<label>账号</label>-->
            <!--<div class="content">-->
                <!--{{ag.account}}-->
            <!--</div>-->
        <!--</div>-->
        <div class="mui-input-row">
            <label>代理级别</label>
            <div class="content">
                {{ag.levelname}}代理
            </div>
        </div>
        <!--<div class="mui-input-row">-->
            <!--<label>身份证</label>-->
            <!--<div class="content">-->
                <!--{{ag.idcard}}-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="mui-input-row">-->
            <!--<label>电话</label>-->
            <!--<div class="content">-->
                <!--{{ag.phone}}-->
            <!--</div>-->
        <!--</div>-->
            <div class="agent-details-btn">
                <button class="mui-btn" style="width: 85%;background: #F2373B;color: #fff;" ng-click="index(aurl)">去购物</button>
                <button class="mui-btn" style="width: 85%;margin-top: 10px;" ng-click="register(aurl)">注册</button>
            </div>
    </div>
</div>

</body>
<script>
    var app = angular.module('myApp', []);
    app.controller('Ctrl', function($scope,$http) {
        $http({
            method: 'POST',
            data:{'id':getUrlParam('id')},
            headers: {'Content-Type': 'application/x-www-form-urlencoded'},
            transformRequest: function (obj) {
                var str = [];
                for (var p in obj) {
                    str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
                }
                return str.join("&");
            },
            url: "/index.php/Home/Index/agenDetail"
        }).then(function successCallback(response) {
            if(response.data.code==-1){
                layer.msg(response.data.msg,{time:1000})
            }
            else if(response.data.code==0){
//                console.log(response.data.data)
                $scope.ag=response.data.data.agen
                $scope.aurl=response.data.data.aurl
            }
        }, function errorCallback(response) {
        });


        //购物
        $scope.index = function (aurl) {
            if(aurl == null){
                layer.msg("该代理尚未申请推广编码，无法购物",{time:1000})
            } else {
                window.location.href = '/index.php/home/index/index?id='+aurl;
            }
        }


        //注册
        $scope.register = function (aurl) {
            if(aurl == null){
                layer.msg("该代理尚未申请推广编码，无法注册",{time:1000})
            } else {
                window.location.href = '/index.php/home/index/register?id=' + aurl;
            }
        }
    });



</script>
</html>